<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Classes - Fuel Documentation</title>
	<link href="../assets/css/main.css" media="screen" rel="stylesheet" />
	<script type="text/javascript" src="../assets/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../assets/js/nav.js"></script>
	<script type="text/javascript" src="../assets/js/highlight.pack.js"></script>
	<script type="text/javascript">
		$(function() {
			show_nav('general', '../');
		});
		hljs.tabReplace = '    ';
		hljs.initHighlightingOnLoad();
	</script>
</head>
<body>

	<header>
		<h1>Fuel Documentation</h1>
	</header>

	<div id="main-nav"></div>

	<section id="content">
		<h2>Classes</h2>

		<h3>What is a class?</h3>

		<p>A class is just a normal PHP class. It doesn't need to extend anything or follow any conventions other than the naming convention which is the same as all other classes in Fuel.</p>

<pre><code>class Session</code></pre>

		<p>That will be loaded from app/classes/session.php.</p>

		<h3>Loading Classes</h3>

		<p>Unlike some other frameworks classes do not need to be loaded manually. They will be auto-loaded when you refer to them in your code (Controllers, Models, etc).</p>

		<h3>Classes in a sub-directory</h3>

		<p>Just like <a href="controllers.html">Controllers</a>, classes must be lower-case with first-letter upper case, while underscores will put the class into a sub-directory.</p>

<pre><code>Class Session_Driver</code></pre>

		<p>That will be loaded from app/classes/session/driver.php</p>


	</section>

	<section id="footer">
		<p>
			<a href="http://fuelphp.com">Fuel</a> is released under the MIT license.<br />
			&copy; 2010 - 2011 Fuel Development Team
		</p>
	</section>

</body>
</html>
